<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 <title><? echo $title ?></title>
<? require("lib.php"); ?>
</head>
<body>
<div class="content-box"><!-- Start Content Box -->
  <div class="content-box-header">
      <h3><? echo $title ?></h3>
      <div class="clear"></div>
  </div> <!-- End .content-box-header -->
  <div class="content-box-content">
<?
switch ($do) {
  case "flip":
  flip($id);
  break;
  default:
  show_info($info);
}
 ?>

	<? function show_boxes($result){
		global $url, $page, $pages, $cateid, $cate, $s, $lang, $arrcurrency;
    		$str='<table width="99%" cellspacing="0" class="mlist"><tr class="th"><td><strong>#</strong></td><td><strong>'.ROOT_DESCRIPTION.'</strong></td><td><a class="hide" href="'.$url.'.php?do=add">[ '.ROOT_ADD.' ]</a></td></tr>';
		$count=1;
    foreach( $result as $row)
		{
			$uid=decode($row['id']);
			$enable=$row['is_enabled']?ROOT_DISABLE:ROOT_ENABLE;
			$str.="<tr ".(($row['is_enabled'])?"":"class=\"disabled\"")."><td>".$uid.".</td><td>".decode($row['description_'.$lang])."</td><td>";
			//if($row['optional']) {
				$str.="<a href=\"$url.php?do=flip&cateid=$cateid&page=$page&id=".decode($row['id'])."\">".$enable."</a>";
			//}
			//else {
			//	$str.=ROOT_DISABLE;
			//}
			$str.="</td></tr>";
			$count++;
		}
		$str.= "</table>";
		echo $str;
		if($count==1) echo "<br>".ROOT_NO_DATA."!";
		echo echo_page($page, $pages, $url.'-'.$cateid.'-p');
         } ?>
     <br class="clear" />
		</div> <!-- End .content-box-content -->
    <br class="clear" />
	</div><!-- End .content-box -->
</body>
</html>